﻿<%@ WebHandler Language="C#" Class="mmserver" %>

using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections.Generic;
/// <summary>
/// tuuuuu
/// </summary>
public class mmserver : IHttpHandler
{
    internal static string sConnectionstring = "";
    internal static System.Globalization.NumberFormatInfo numberFormat_EnUS = new System.Globalization.CultureInfo("en-US", false).NumberFormat;
    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    static public String EncodeUrl(String sUrl)
    {
        if (sUrl != null)
        {
            sUrl = sUrl.Replace("%3C", "<");
            sUrl = sUrl.Replace("%3E", ">");
            sUrl = sUrl.Replace("%2F", "/");
            sUrl = sUrl.Replace("%20", " ");
            sUrl = sUrl.Replace("%3A", ":");
            sUrl = sUrl.Replace("%2D", "-");
            sUrl = sUrl.Replace("%2K", "&");
            sUrl = sUrl.Replace("%2T", "%");

            return sUrl;
        }
        return "";
    }
    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    public void ProcessRequest(HttpContext context)
    {
        mtserver mt = new mtserver(getLogin(), context);
        if (!mt.doAction())
        {
            context.Response.Write("Wellcome");           
        }
    }
    /// <summary>
    /// 
    /// </summaryc  
    /// <returns></returns>
    public TUnit.Class.CLogin InitConfig()
    {
        string server = System.Configuration.ConfigurationManager.AppSettings["servername"].ToString();
        string user = System.Configuration.ConfigurationManager.AppSettings["user"].ToString();
        string pass = System.Configuration.ConfigurationManager.AppSettings["pass"].ToString();
        string sConnectionstring = "Provider=SQLOLEDB.1;Password = " + pass + ";Persist Security Info=True;User ID = " + user + ";Initial Catalog = dbviclip;Data Source= " + server + ";";
        TUnit.Class.CLogin Login = new TUnit.Class.CLogin(sConnectionstring);
        return Login;
    }
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    public TUnit.Class.CLogin getLogin()
    {
        string Connectionstring = "Provider=SQLOLEDB.1;Password = 123adminazsoft;Persist Security Info=True;User ID = azsoft_usdb;Initial Catalog =azsoft_com_vn_db;Data Source=112.213.89.156;";
        TUnit.Class.CLogin Login = new TUnit.Class.CLogin(Connectionstring);
        Login.Login = Login;
        return Login;
    }
    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}